// MusicPlayer 类
class MusicPlayer {
  private var playlist: List[String] = List()
  private var currentSong: Option[String] = None
  private var playMode: String = "Sequential" // Sequential, Shuffle, Loop

  def addSong(song: String): Unit = {
    playlist = song :: playlist
    println(s"Added song: $song")
  }

  def removeSong(song: String): Unit = {
    playlist = playlist.filterNot(_ == song)
    println(s"Removed song: $song")
  }

  def playSong(song: String): Unit = {
    if (playlist.contains(song)) {
      currentSong = Some(song)
      println(s"Playing: $song")
    } else {
      println(s"Song $song not found in playlist.")
    }
  }

  def showPlaylist(): Unit = {
    println("Playlist:")
    playlist.foreach(println)
  }
}

// 测试
object MusicPlayerTest extends App {
  val player = new MusicPlayer
  player.addSong("Song A")
  player.addSong("Song B")
  player.addSong("Song C")

  player.showPlaylist()
  player.playSong("Song B")
  player.removeSong("Song A")
}
